﻿/*
 * @Autor: PK
 * @Date: 2022/06/14 14:31:23
 */

using System;
using System.Collections.Generic;
using ShkSimulation.core.dao.input.loader;
using ShkSimulation.core.dao.input.resource;
using ShkSimulation.core.factory;
using ShkSimulation.core.template;
using ShkSimulation.core.template.agency;
using ShkSimulation.core.template.customer;
using ShkSimulation.core.template.model;

namespace ShkSimulation.highway {

	public class HighwayNetwork: AbstractNetwork {

        private HighwayNetwork(int id,
            NetworkInputData inputData, 
            NetworkResultCollector resultCollector, 
            DemandManager demandManager, 
            int seed) : base(id, inputData, resultCollector, demandManager, FactoriesCreateFunction, seed) {
        }
        
        public static HighwayNetwork BuildNetwork(NetworkInputData inputData) {
            return new HighwayNetwork(-1, inputData, new NetworkResultHolder(), new VehicleInputManager(), 1);
        }

        protected static List<AgencyFactory> FactoriesCreateFunction(NetworkInputData networkInput) {
            // 只有RoadSection一类
            AgencyFactory factory = FactoryProvider.CreateFactory("roadSection", RoadSectionCreateUtil.CreateByResource);
            // 也可以使用下面的，两种创建逻辑
            // AgencyFactory factory = FactoryProvider.CreateFactory("roadSection", RoadSectionFactory.CreateSingleAgency);
            return new List<AgencyFactory>() { factory };
        }


    }

}